﻿Ext.onReady(function () {
    MainSafe();
    GetHeader();
});

//获取头部信息
var GetHeader = function () {
    document.getElementById("bd").style.height = window.screen.height-296;
    var re = new JsonRequest();
    Ext.Ajax.request({
        url: Ext.getClassUrl('BaseManager.MainView', 'GetHeader'),
        jsonData: re,
        success: function (re, op) {
            var obj = Ext.decode(re.responseText);
            if (obj.ResponseObject != "") {
                document.getElementById("uname").innerHTML = obj.ResponseObject.split("|")[0];
                document.getElementById("utime").innerHTML = obj.ResponseObject.split("|")[1];
            }
        }
    });
}

//安全退出
var ExitSys = function () {
    var re = new JsonRequest();
    Ext.Ajax.request({
        url: Ext.getClassUrl('BaseManager.MainView', 'ExitSystem'),
        jsonData: re,
        success: function (re, op) {
            var obj = Ext.decode(re.responseText);
            if (!obj.HasError) {
                window.location = "index.aspx";
            }
        }
    });
}